<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function canJump(nums) {
            let max = nums[0]
            for (let i=1; i<nums.length-1; i++) {
                if(max>=i && nums[i]+i>max){
                    max = nums[i]+i
                }
            }
            if(max>=nums.length-1) return true
            return false
        }
        console.log(canJump([0,2,3]))
    </script>
</body>
</html>